<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.js"></script>
</head>
<body>
  <h1>学习目标</h1>
  <div>
  <p>1.如何创建node服务器</p>
  <p>2.如何接受客户端请求post and get  form请求</p>
  <p>3.如何响应客户端请求</p>
  <p>4.如何读取文件</p>
  </div>
  <button id='post'>post</button>
  <button id='get'>get</button>
  <form ip="upload" action="/upload" method="post">
    <input type="file"  enctype='multipart/form-data'>
    <input type="button" value="上传">
  </form>

  <h2>响应数据的内容</h2>
  <p id='contet'></p>
</body>
<script>
    $('#post').on('click',function(){
      $.post('/post',{key:"post"},function(res){
        $('#contet').html(res)
        console.log(res)
      })
    })
     $('#get').on('click',function(){
      $.get('/get',{key:"get"},function(res){
        $('#contet').html(res)
        console.log(res)
      })
    })
  </script>
</html>
